package com.caseeye.base

import scala.reflect.BeanProperty
import javax.annotation.Resource
import org.springframework.beans.factory.annotation.Required
import com.caseeye.util.RichDomainObjectFactory

trait Repository {

    @BeanProperty
    @Resource
    @Required
    var richDomainObjectFactory : RichDomainObjectFactory = null

    def createRichDomainObject[T <% Entity](t : Class[T]) : T = richDomainObjectFactory.autowire(t.newInstance)

}